﻿<div class="blade-static __expanded">
	<div class="form-group">
		<div class="form-input __search">
			<input placeholder="Search keyword..." ng-model="filter.searchKeyword" ng-keyup="$event.which === 13 && blade.refresh()">
		</div>
		<p class="form-count">Count: <span class="count">{{pageSettings.totalItems}}</span></p>
	</div>
</div>
<div class="blade-static __bottom" ng-if="pageSettings.itemsPerPageCount < pageSettings.totalItems" ng-include="'pagerTemplate.html'"></div>
<div class="blade-content __large-wide">
	<div class="blade-inner">
		<div class="inner-block">
			<div class="table-wrapper" ng-if="blade.currentEntities.length > 0">
				<table class="table" style="margin-bottom:70px;">
					<thead>
						<tr>
							<th class="table-col __product-control">
								<label class="form-control __checkbox">
									<input type="checkbox" ng-model="blade.selectedAll" ng-change="blade.checkAll(blade.selectedAll)" />
									<span class="check"></span>
								</label>
							</th>
							<th class="table-col">Display Name</th>
							<th class="table-col">Recipient</th>
							<th class="table-col">Sent Date</th>
							<th class="table-col">Channel</th>
						</tr>
					</thead>
					<tbody>
						<tr class="table-item" ng-repeat="data in blade.currentEntities track by data.id" ng-class="{'__selected': data.id === blade.selectedItemId}">
							<td class="table-col">
								<label class="form-control __checkbox">
									<input type="checkbox" ng-model="data.selected" ng-change="blade.selectedAll = false;">
									<span class="check"></span>
								</label>
							</td>
							<td class="table-col" ng-click='blade.openNotification(data)'>
								<span class="table-t">{{data.displayName}}</span>
								<span class="table-status" ng-if="!data.isActive && !data.isSuccessSend" style="background:red">Error</span>
								<span class="table-status" ng-if="data.isActive && !data.isSuccessSend" style="max-width:60px;">Processing</span>
								<span class="table-status __active" ng-if="(!data.isActive && data.isSuccessSend) || (data.isActive && data.isSuccessSend)">Success</span>
							</td>
							<td class="table-col" ng-click='blade.openNotification(data)'>
								{{data.recipient}}
							</td>
							<td class="table-col __date" ng-click='blade.openNotification(data)'>
								{{data.sendingDate}}
							</td>
							<td class="table-col" ng-click='blade.openNotification(data)'>
								<div class="product-img">
									<i class="table-ico fa fa-envelope" ng-if="data.isEmail"></i>
									<i class="table-ico fa fa-mobile" ng-if="data.isSms"></i>
								</div>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
			<div class="note" ng-if="items.length == 0">
				No notifications yet
			</div>
		</div>
	</div>
</div>